$(function(){
//顶部登录区
    $('#top-1-login-bg #login-box #right-login #recent-see').mouseover(function(){//移入【最近浏览】显示
        $('#top-1-login-bg #login-box #right-login #recent-see').css({
            'width':'77px',
            'height':'28px',
            'margin-top':'2px',
            'line-height': '24px',
            'border':'1px solid #E0E0E0',
            'border-bottom': 'none',
            'background': 'white',
            'cursor': 'default',
        })
        $('#top-1-login-bg #login-box #right-login #recent-see .down').css('display','block');
        $('#top-1-login-bg #login-box #right-login #recent-see .ico-down-white').css('display','block');
    })
    $('#top-1-login-bg #login-box #right-login #recent-see').mouseout(function(){//移出【最近浏览】隐藏
        $('#top-1-login-bg #login-box #right-login #recent-see').css({
            'width':'79px',
            'height':'30px',
            'margin-top':'0px',
            'line-height': '30px',
            'border':'none',
            'background': 'none',
        })
        $('#top-1-login-bg #login-box #right-login #recent-see .down').css('display','none');
        $('#top-1-login-bg #login-box #right-login #recent-see .ico-down-white').css('display','none');
    })


    $('#top-1-login-bg #login-box #right-login #my-lashou').mouseover(function(){//移入【我的拉手】显示
        $('#top-1-login-bg #login-box #right-login #my-lashou').css({
            'width':'77px',
            'height':'28px',
            'margin-top':'2px',
            'line-height': '24px',
            'border':'1px solid #E0E0E0',
            'border-bottom': 'none',
            'background': 'white',
        })
        $('#top-1-login-bg #login-box #right-login #my-lashou .down').css('display','block');
        $('#top-1-login-bg #login-box #right-login #my-lashou .ico-down-white').css('display','block');
    })
    $('#top-1-login-bg #login-box #right-login #my-lashou').mouseout(function(){//移出【我的拉手】隐藏
        $('#top-1-login-bg #login-box #right-login #my-lashou').css({
            'width':'79px',
            'height':'30px',
            'margin-top':'0px',
            'line-height': '30px',
            'border':'none',
            'background': 'none',
        })
        $('#top-1-login-bg #login-box #right-login #my-lashou .down').css('display','none');
        $('#top-1-login-bg #login-box #right-login #my-lashou .ico-down-white').css('display','none');
    })

//顶部广告轮播区
    $('#top-2-ad-flash .ico-x').click(function(){//点击关闭广告轮播区
        $('#top-2-ad-flash').css('display','none');
    })


    setInterval(function(){//无缝滚动【未完成】
        $('#top-2-ad-flash').append($('#top-2-ad-flash a').first());
        $('#top-2-ad-flash a').last().css('height','63px');
        $('#top-2-ad-flash a').first().animate({'height':'0px'},2000);
    },3000)


//手机上拉手mouseover二维码
    $('#top-4-nav #nav-box #right-mobile-lashou').mouseover(function(){
        // alert('kk')
        $('#top-4-nav #nav-box #right-mobile-lashou #mobile-QR').css('display','block');
    })
    $('#top-4-nav #nav-box #right-mobile-lashou').mouseout(function(){
        // alert('oo')
        $('#top-4-nav #nav-box #right-mobile-lashou #mobile-QR').css('display','none');
    })


//主要内容中间区"更多"mouseover效果
    $('#main-1-box .center-box #goods-list .list-1 .list-1-1 .more').mouseover(function(){
        $('#main-1-box').css('height','577px');
        $('#main-1-box .center-box').css('height','576px');
        $('#main-1-box .center-box #goods-list .list-zone-more').css('height','70px');
        $('#main-1-box .center-box #goods-list .list-1 .list-1-1 #more-ul').css('display','block');

    })

    $('#main-1-box .center-box #goods-list .list-zone-more').mouseleave(function(){
        $('#main-1-box').css('height','556px');
        $('#main-1-box .center-box').css('height','555px');
        $('#main-1-box .center-box #goods-list .list-zone-more').css('height','48px');
        $('#main-1-box .center-box #goods-list .list-1 .list-1-1 #more-ul').css('display','none');
    })


//主要内容区轮播图按钮mouseover/mouseout显隐效果
    $('#main-1-box .center-box #main-flash-box').mouseenter(function(){
        $('#main-1-box .center-box #main-flash-box #slide-left').animate({'left':'5px'},200);
        $('#main-1-box .center-box #main-flash-box #slide-right').animate({'right':'5px'},200);
    })
    $('#main-1-box .center-box #main-flash-box').mouseleave(function(){
        $('#main-1-box .center-box #main-flash-box #slide-left').animate({'left':'-42px'},200);
        $('#main-1-box .center-box #main-flash-box #slide-right').animate({'right':'-42px'},200);
    })




//主要内容区右侧下部的tab切换效果
    $('#main-1-box .right-box .right-bottom-box .title li').eq(0).css({'border-bottom-color':'white'}).find('a').find('.ico-arrow').css({'background-position':'-74px -117px'});

    $('#main-1-box .right-box .right-bottom-box .title li').mouseenter(function(){
        $('#main-1-box .right-box .right-bottom-box .content').eq($(this).index()).show().siblings('.content').hide();//tab切换
        $(this).css({'border-bottom-color':'white'}).siblings('li').css({'border-bottom-color':'#E0E0E0'});//选项卡功能实现
       $(this).find('a').find('.ico-arrow').css({'background-position':'-74px -117px'});//改变小箭头方向
       $(this).siblings('li').find('a').find('.ico-arrow').css({'background-position':'-74px -114px'});

        //$(this).find('a').find('.ico-tu').animate({'top':'-10px'},50);
       // setTimeout(function(){
        //    $(this).find('a').find('.ico-tu').animate({'top':'5px'},50);
       // },50)
    })



//main-2-box的今日新单、一周热卖的点中样式变化
    $('#main-2-box ul.title li').click(function(){
        $(this).addClass('clicked').siblings('li').removeClass('clicked');
        $(this).find('i').css('display','block');
        $(this).siblings('li').find('i').css('display','none');
    })

//main-2-box的无缝轮播效果(轮播小圆点未完成）
    var flashNum=0;
    var leftNum=0;
    $('#main-2-box ul.flash-dot-btn li').eq(0).css('background','#FF9000');
    setInterval(function(){
        flashNum++;
        if(flashNum==5) {
            $('#main-2-box #flash-big-box #flash-content-many-box').css({'left': '0px'});
            flashNum = 1;
            //$('#main-2-box ul.flash-dot-btn li').eq(0).css('background', '#FF9000').siblings('li').css('background', '#DCDCDC');
        }
        leftNum = flashNum*-1205+'px';
        $('#main-2-box #flash-big-box #flash-content-many-box').animate({'left':leftNum},500);

        $('#main-2-box ul.flash-dot-btn li').eq(flashNum).css('background','#FF9000').siblings('li').css('background','#DCDCDC');
    },3000);


//给.goods-content-box的.goods-storeSite设置鼠标移入/移出显隐效果
        $('.content-box .goods-content-box .goods-content').mouseenter(function(){
            $(this).find('.goods-storeSite').fadeIn(500);
        })
        $('.content-box .goods-content-box .goods-content').mouseleave(function(){
            $(this).find('.goods-storeSite').fadeOut(500);
        })


//底部团购tab切换
    $('.tab-tuanGou .tab-title li').eq(0).css('border-left','none');
    $('.tab-tuanGou .tab-title li').click(function(){
        $('.tab-tuanGou .tab').eq($(this).index()).addClass('vis').siblings('.tab').removeClass('vis');
        $(this).addClass('cur').siblings('li').removeClass('cur');
    })


//固定定位菜单栏
    var colorArr=['#AC735F','#EF6452','#A566D9','#6F7EDB','#82BC55','#C89D66','#5CB0C8','#4CAF7D','#DA6CB3'];

    var num
    $('.fixed-box .content-btn li').click(function(){
        num=$(this).index();
        $(this).css({'background':colorArr[$(this).index()]}).siblings('li').css({'background':'white'});
        $(this).find('a').css('color','#fff');
        $(this).siblings('li').find('a').css('color','#565656');
    });

    $('.fixed-box .content-btn li').mouseenter(function(){
        $(this).css({'background':colorArr[$(this).index()]}).siblings('li').css({'background':'none'});
        $(this).find('a').css('color','#fff');
        $(this).siblings('li').find('a').css('color','#565656');
    });
    $('.fixed-box .content-btn li').eq(num).css({'background':colorArr[num]});
})//$(function(){})